﻿USE master
GO

IF	EXISTS (SELECT * FROM SYS.DATABASES WHERE NAME='aspShopOnline')
DROP DATABASE aspShopOnline
GO

CREATE DATABASE aspShopOnline
GO

USE aspShopOnline
GO

CREATE TABLE [dbo].[Product]
(
	[productId] varchar(100) primary key,
	[productName] nvarchar(100),
	[productPrice] decimal,
	[productStatus] nvarchar(100),
	[productQuantity] int,
	[productType] nvarchar(100),
	[productImage] nvarchar(200)
)
GO

CREATE PROC getRadom4Product
AS
BEGIN
	SELECT TOP 4 [productImage],[productId],[productName],[productPrice] FROM [dbo].[Product] where [productType]='Váy'ORDER BY NEWID() 
END
GO

CREATE PROC getRadom4Product1
AS
BEGIN
	SELECT TOP 4 [productImage],[productId],[productName],[productPrice] FROM [dbo].[Product] where [productType]=N'Thắt Lưng' ORDER BY NEWID() 
END
GO

EXEC getRadom4Product1
GO

CREATE PROC getRadom3ProductBags
AS
BEGIN
	SELECT TOP 4 [productImage],[productId],[productName],[productPrice] FROM [dbo].[Product] where [productType]=N'hung'
END
GO
